#pragma  once
class ResourceLocker
{
public:
	explicit ResourceLocker(LPCRITICAL_SECTION plock):
	plock_(plock)
	{
		EnterCriticalSection(plock_);
	}
	~ResourceLocker()
	{
		LeaveCriticalSection(plock_);
	}
private:
	ResourceLocker(ResourceLocker& other){}
	void operator=(ResourceLocker& other){}
	LPCRITICAL_SECTION  plock_;
};